# Author fengzhilaoling
# coding=utf-8
# @Time    : 2020/10/2 上午11:51
# @Site    : 
# @File    : __init__.py.py
# @Software: PyCharm
# @contact: fengzhilaoling@163.com
from flask import Flask

from APP.ext import init_ext
from APP.views import init_view
from APP.settings import envs
# from APP.models import *


def create_app(env):
    app = Flask(__name__)
    app.config.from_object(envs[env])  # 初始化配置
    init_view(app)  # 初始化视图函数
    init_ext(app)  # 初始化第三方插件
    return app
